home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / faq / comp / motif_fa / part4 < prev    next >
Text File  |  1994-04-14  |  64KB  |  1,494 lines

  1. Path: bloom-beacon.mit.edu!grapevine.lcs.mit.edu!olivea!charnel!charnel.net.csuchico.edu!nic-nac.CSU.net!usc!howland.reston.ans.net!europa.eng.gtefsd.com!news.umbc.edu!cs.umd.edu!kong.gsfc.nasa.gov!kong.gsfc.nasa.gov!not-for-mail
  2. From: dealy@kong.gsfc.nasa.gov (Brian Dealy)
  3. Newsgroups: comp.windows.x.motif,news.answers,comp.answers
  4. Subject: Motif FAQ (Part 4 of 5)
  5. Followup-To: poster
  6. Date: 14 Apr 1994 15:20:37 -0400
  7. Organization: NASA/Goddard Space Flight Center
  8. Lines: 1476
  9. Approved: news-answers-request@MIT.Edu
  10. Distribution: inet
  11. Expires: +1 months
  12. Message-ID: <2ok525$5ep@kong.gsfc.nasa.gov>
  13. Reply-To: dealy@kong.gsfc.nasa.gov (Brian Dealy)
  14. NNTP-Posting-Host: kong.gsfc.nasa.gov
  15. Keywords: FAQ question answer
  16. Xref: bloom-beacon.mit.edu comp.windows.x.motif:15729 news.answers:18060 comp.answers:4911
  17.  
  18.  
  19. Archive-name: motif-faq/part4
  20. Last-modified: APR 04, 1994
  21. Version: 3.6
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. -----------------------------------------------------------------------------
  29. Subject: 96)  TOPIC: XMSTRING
  30.  
  31. -----------------------------------------------------------------------------
  32. Subject: 97)  How can I get the Ascii text out of an XmString?
  33.  
  34. Answer: To get the first line of text from a string created left-to-right
  35.  
  36.  
  37.         char *str;
  38.         XmString xmstr;
  39.  
  40.         /* stuff to create xmstr */
  41.         ...
  42.  
  43.         /* set str to point to the text */
  44.         XmStringGetLtoR(xmstr, XmSTRING_DEFAULT_CHARSET, &str);
  45.         /* use the string */
  46.         ...
  47.  
  48.         /* and reclaim space */
  49.         XtFree(str);
  50.  
  51.  
  52. -----------------------------------------------------------------------------
  53. Subject: 98)  When can XmStrings used as resources be freed?
  54.  
  55. Answer: The policy OSF have been trying to enforce is that if you set an
  56. XmString or XmStringTable resource, the application is responsible for freeing
  57. the XmStrings used because the widget makes a copy.  If you get an XmString
  58. resource, then the application must free the value gotten.  If you get an
  59. XmStringTable, then the application should NOT free the value gotten.  If the
  60. application wants to manipulate it, it should make a copy first. This policy
  61. appears to be implemented progressively, so may be less true for Motif 1.0
  62. than 1.1.
  63.  
  64. -----------------------------------------------------------------------------
  65. Subject: 99)  Why doesn't XmStringGetNextSegment() work properly?
  66.  
  67. Answer: The documentation in Motif 1.0 is in error. Instead of
  68.  
  69.         XmStringGetnextSegment(context, ...)
  70.         XmStringContext * context;
  71.  
  72. it should be
  73.  
  74.         XmStringGetnextSegment(context, ...)
  75.         XmStringContext context;
  76.  
  77. i.e. with no indirection.
  78.  
  79.  
  80. -----------------------------------------------------------------------------
  81. Subject: 100)  Why does using XmStringDraw cause a Bad Font error?
  82.  
  83. [Last modified: May 93]
  84.  
  85. Answer: From Thomas Berlage (berlage@gmdzi.gmd.de): You could call this a bug
  86. in Motif. You pass a GC to XmStringDraw, however, Motif wants to use the fonts
  87. from the font list to draw the string.  Therefore it replaces the font of the
  88. GC temporarily with some fonts of its own as specified in the font list. In
  89. the end it tries to restore the old font of the GC. There comes the problem:
  90.  
  91. If a GC uses the default font, the client side GC structure does not have a
  92. valid font id (that is the 0xffffffff you may see in the error message). Motif
  93. tries to restore this invalid id at the end.
  94.  
  95. The workaround is: Before drawing with XmStringDraw, set the font id of the GC
  96. to any valid font id, for example using
  97.  
  98.       XSetFont (display, gc, XLoadFont (display, "fixed"));
  99.  
  100.  
  101.  
  102.  
  103. -----------------------------------------------------------------------------
  104. Subject: 101)  TOPIC: DIALOGS
  105.  
  106. -----------------------------------------------------------------------------
  107. Subject: 102)  How do I stop my dialog disappearing when I press the help
  108. button?
  109.  
  110. Answer: Bulletin board has the resource autoUnmanage which defaults to True.
  111. This unmanages the widget when any button child is activated - including the
  112. help button.  Set this to False to stop it disappearing. Note that you then
  113. have to unmanage the bulletin board yourself when any other button is
  114. activated.
  115.  
  116. -----------------------------------------------------------------------------
  117. Subject: 103)  How do I make my own dialog?  I want a dialog with my own set
  118. of buttons that stretch and shrink like the ones in e.g. PromptDialog and its
  119. own contents.
  120.  
  121. Answer: Start off with say a PromptDialog. Unmanage the buttons you don't want
  122. or manage the Apply button if you want another. Unmanage the other bits of the
  123. selection box you don't want. You can add another WorkArea child to the
  124. selection box for any extra stuff you want.
  125.  
  126.     /* Copyright 1990, Kee Hinckley and Brian Holt Hawthorne */
  127.     /* Permission granted for any use, provided this copyright */
  128.     /* notice is maintained. */
  129.  
  130.     /* Create a dialog box */
  131.     argcount = setArgs(&args, XmNautoUnmanage, False, NULL);
  132.     SomeDialog = XmCreatePromptDialog(mainShell, "someDialog", args, argcount);
  133.  
  134.     /* Now get rid of the things we don't want */
  135.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_SELECTION_LABEL);
  136.     XtUnmanageChild(child);
  137.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_TEXT);
  138.     XtUnmanageChild(child);
  139.  
  140.     /* set the callbacks, and make sure the buttons we want are there */
  141.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_OK_BUTTON);
  142.     XtAddCallback(child, XmNactivateCallback, callSomeFunc, someArg);
  143.     XtAddCallback(child, XmNactivateCallback, unManage, SomeDialog);
  144.     XtManageChild(child);
  145.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_APPLY_BUTTON);
  146.     XtAddCallback(child, XmNactivateCallback, callSomeFunc, someOtherArg);
  147.     XtManageChild(child);
  148.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_CANCEL_BUTTON);
  149.     XtAddCallback(child, XmNactivateCallback, dialogUnmanage, SomeDialog);
  150.     XtManageChild(child);
  151.  
  152.     /* Add a new work area. This can be any manager. */
  153.     child = XmCreateForm(SomeDialog, "someForm", NULL, 0);
  154.     XtManageChild(child);
  155.  
  156.     /* and fill it up... */
  157.     something = doYourStuff(child);
  158.  
  159. another Answer:
  160.  
  161.         I had a some people asking about my xmSmartMessageBoxWidget
  162.  
  163.         It's public domain, and needs Motif-1.2  and is available at
  164.         ftp.x.org:/contrib/widget/SmartMB.tar.Z.
  165.  
  166.         The basic idea behind it is that it allows the programmer to
  167.         specify the management of child widgets in 4 areas: Label, Control,
  168.         Separator and Action.  You can have up to 1 Label, 1 Control,
  169.         1 Separator and as many Action children as you want.  It does not
  170.         REQUIRE any of these, and there is no unmanaging of extra widgets,
  171.         as the programmer creates what is needed.
  172.  
  173.         Thanks for the smart dialog info to:         John L. Cwikla
  174.         Wolfram Research, Inc.          cwikla@wri.com
  175.  
  176.  
  177.  
  178.  
  179. -----------------------------------------------------------------------------
  180. Subject: 104)  How come the title bars for my dialogs now have "_popup" or
  181. "<-popup" concatenated onto the widget name?
  182.  
  183.  
  184. Answer: Motif 1.0.3 (?) "fixed" things such that title bars without an
  185. explicit dialogTitle setting use the widget name with "_popup" or whatever
  186. added on.  Set the dialogTitle resource explicitly if you don't want this new
  187. default naming scheme.
  188.  
  189. -----------------------------------------------------------------------------
  190. Subject: 105)  How can I force a dialog window to display?  I manage a
  191. "working" dialog, and do some computing, but the dialog window appears blank
  192. until the work has finished.  How can I force it to be displayed?
  193.  
  194. Answer: Use this.  (David Brooks, Systems Engineering, Open Software
  195. Foundation)
  196.  
  197. /*
  198.  * This procedure will ensure that, if a dialog window is being mapped,
  199.  * its contents become visible before returning.  It is intended to be
  200.  * used just before a bout of computing that doesn't service the display.
  201.  * You should still call XmUpdateDisplay() at intervals during this
  202.  * computing if possible.
  203.  *
  204.  * The monitoring of window states is necessary because attempts to map
  205.  * the dialog are redirected to the window manager (if there is one) and
  206.  * this introduces a significant delay before the window is actually mapped
  207.  * and exposed.  This code works under mwm, twm, uwm, and no-wm.  It
  208.  * doesn't work (but doesn't hang) with olwm if the mainwindow is iconified.
  209.  *
  210.  * The argument to ForceDialog is any widget in the dialog (often it
  211.  * will be the BulletinBoard child of a DialogShell).
  212.  */
  213.  
  214. ForceDialog(w)
  215.      Widget w;
  216. {
  217.   Widget diashell, topshell;
  218.   Window diawindow, topwindow;
  219.   Display *dpy;
  220.   XWindowAttributes xwa;
  221.   XEvent event;
  222.   XtAppContext cxt;
  223.  
  224. /* Locate the shell we are interested in.  In a particular instance, you
  225.  * may know these shells already.
  226.  */
  227.  
  228.   for (diashell = w;
  229.        !XtIsShell(diashell);
  230.        diashell = XtParent(diashell))
  231.     ;
  232.  
  233. /* Locate its primary window's shell (which may be the same) */
  234.  
  235.   for (topshell = diashell;
  236.        !XtIsTopLevelShell(topshell);
  237.        topshell = XtParent(topshell))
  238.     ;
  239.  
  240.   if (XtIsRealized(diashell) && XtIsRealized(topshell)) {
  241.     dpy = XtDisplay(topshell);
  242.     diawindow = XtWindow(diashell);
  243.     topwindow = XtWindow(topshell);
  244.     cxt = XtWidgetToApplicationContext(diashell);
  245.  
  246. /* Wait for the dialog to be mapped.  It's guaranteed to become so unless... */
  247.  
  248.     while (XGetWindowAttributes(dpy, diawindow, &xwa),
  249.            xwa.map_state != IsViewable) {
  250.  
  251. /* ...if the primary is (or becomes) unviewable or unmapped, it's
  252.    probably iconified, and nothing will happen. */
  253.  
  254.       if (XGetWindowAttributes(dpy, topwindow, &xwa),
  255.           xwa.map_state != IsViewable)
  256.         break;
  257.  
  258. /* At this stage, we are guaranteed there will be an event of some kind.
  259.    Beware; we are presumably in a callback, so this can recurse. */
  260.  
  261.       XtAppNextEvent(cxt, &event);
  262.       XtDispatchEvent(&event);
  263.     }
  264.   }
  265.  
  266. /* The next XSync() will get an expose event if the dialog was unmapped. */
  267.  
  268.   XmUpdateDisplay(topshell);
  269. }
  270.  
  271.  
  272. -----------------------------------------------------------------------------
  273. Subject: 106)  How can I control placement of a popup widget?  Each time a
  274. popup is created, it is placed in or over the middle of its parent.  How can I
  275. make it obey the XmNx and XmNy values?
  276.  
  277. Answer: Set the resource XmNdefaultPosition for the popup to False.  Set the
  278. position of the popup by the resource values of XmNx and XmNy.  Do not use
  279. XtMoveWidget, as this is for widget writers only.  Here's a demo program from
  280. Dan Heller:
  281.  
  282. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  283.  * This program is freely distributable without licensing fees and
  284.  * is provided without guarantee or warranty expressed or implied.
  285.  * This program is -not- in the public domain.  This program is
  286.  * taken from the Motif Programming Manual, O'Reilly Volume 6.
  287.  */
  288.  
  289. /* map_dlg.c -- Use the XmNmapCallback to automatically position
  290.  * a dialog on the screen.  Each time the dialog is displayed, it
  291.  * is mapped down and to the right by 200 pixels in each direction.
  292.  */
  293. #include <Xm/MessageB.h>
  294. #include <Xm/PushB.h>
  295.  
  296. /* main() --create a pushbutton whose callback pops up a dialog box */
  297. main(argc, argv)
  298. char *argv[];
  299. {
  300.     Widget toplevel, button;
  301.     XtAppContext app;
  302.     void pushed();
  303.  
  304.     toplevel = XtVaAppInitialize(&app, "Demos",
  305.         NULL, 0, &argc, argv, NULL, NULL);
  306.  
  307.     button = XtCreateManagedWidget("button", xmPushButtonWidgetClass,
  308.         toplevel, NULL, 0);
  309.     XtAddCallback(button, XmNactivateCallback, pushed, "Hello World");
  310.  
  311.     XtRealizeWidget(toplevel);
  312.     XtAppMainLoop(app);
  313. }
  314.  
  315. /* callback function for XmNmapCallback.  Position dialog in 200 pixel
  316.  * "steps".  When the edge of the screen is hit, start over.
  317.  */
  318. static void
  319. map_dialog(dialog, client_data, cbs)
  320. Widget dialog;
  321. XtPointer client_data;
  322. XmAnyCallbackStruct *cbs;
  323. {
  324.     static Position x, y;
  325.     Dimension w, h;
  326.  
  327.     XtVaGetValues(dialog, XmNwidth, &w, XmNheight, &h, NULL);
  328.     if ((x + w) >= WidthOfScreen(XtScreen(dialog)))
  329.         x = 0;
  330.     if ((y + h) >= HeightOfScreen(XtScreen(dialog)))
  331.         y = 0;
  332.     XtVaSetValues(dialog, XmNx, x, XmNy, y, NULL);
  333.     x += 200, y += 200;
  334. }
  335.  
  336. /* pushed() --the callback routine for the main app's pushbutton.
  337.  * Create and popup a dialog box that has callback functions for
  338.  * the Ok, Cancel and Help buttons.
  339.  */
  340. void
  341. pushed(w, message)
  342. Widget w;
  343. char *message; /* The client_data parameter passed by XtAddCallback */
  344. {
  345.     Widget dialog;
  346.     Arg arg[3];
  347.     XmString t = XmStringCreateSimple(message);
  348.     extern void response();
  349.  
  350.     XtSetArg(arg[0], XmNautoUnmanage, False);
  351.     XtSetArg(arg[1], XmNmessageString, t);
  352.     XtSetArg(arg[2], XmNdefaultPosition, False);
  353.     dialog = XmCreateMessageDialog(w, "notice", arg, 3);
  354.     XmStringFree(t);
  355.  
  356.     XtAddCallback(dialog, XmNmapCallback, map_dialog, NULL);
  357.  
  358.     XtManageChild(dialog);
  359.     XtPopup(XtParent(dialog), XtGrabNone);
  360. }
  361.  
  362.  
  363. -----------------------------------------------------------------------------
  364. Subject: 107)  TOPIC: LANGUAGE BINDINGS
  365.  
  366. -----------------------------------------------------------------------------
  367. Subject: 108)* Is there a C++ binding for Motif?
  368.  
  369. [Last modified: May 93]
  370.  
  371.  
  372. Answer: WWL is a library which defines C++ classes around X Toolkit Widgets.
  373. It is intended to simplify the task of C++ code writers when using the Toolkit
  374. by providing them with C++ objects, methods, type checking and several utility
  375. functions and classes.
  376.  
  377. WWL has been tested under SunOs4.0.3 on sun3 and sun4, HPUX version 6.5 and
  378. 7.0 and Ultrix 4.0 on DECstation 3100 and 5000. It is expected to work on most
  379. other UNIX systems without too many problems.
  380.  
  381. WWL is distributed as a tar file with all the source, documentation and
  382. example. The file is available using anonymous ftp from
  383.  
  384.         export.lcs.mit.edu (18.30.0.238   contrib/WWL-1.0.tar.Z
  385.         lri.lri.fr (129.175.15.1)      pub/WWL-1.0.tar.Z
  386.  
  387.  
  388. Answer: Rogue Wave Software has a C++ binding for Motif called View.h++.
  389.  
  390. "View.h++ is a complete C++ interface to OSF/Motif.  It doesn't just
  391. encapsulate it, but also includes a set of classes that provide a level of
  392. abstraction above Motif, thus simplifying menu and dialog creation, XmStrings,
  393. XmFontLists, etc.  View.h++ supports a Model- View-Controller architecture,
  394. allowing for an even more object-oriented interface design.  Includes a copy
  395. of Rogue Wave's Tools.h++ (foundation class library)"
  396.  
  397. An object license is $795 "per seat" and a source code license is available
  398. for $2,995 "per seat."  Rogue Wave also offers full support for View.h++.
  399.  
  400. It is currently available for Sun Sparc, IBM RS/6000, HP 9000/700 series, SCO,
  401. Intel SVR4 ESIX.  Please call for Silicon Graphics and DEC Ultrix status.
  402.  
  403. For additional information, please contact:
  404.  
  405. Matt Steinauer
  406. Rogue Wave Software, Inc.
  407. P.O. Box 2328
  408. Corvallis, OR 97339
  409. Phone: (503)754-3010
  410. Fax:   (503)757-6650
  411.  
  412. email:   matts@roguewave.com
  413.  
  414.  
  415. Answer: Builder Xcessory 3.0, an interface builder from ICS, allows the user
  416. to visually build C++ classes from Motif and user-written widgets.  C++ code
  417. is generated in the "Doug Young" fashion.  (Doug actually worked on this
  418. project with ICS.)  C and UIL can also be generated.
  419.  
  420. Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
  421. USA info@ics.com   617/621-0060
  422.  
  423.  
  424.  
  425. Answer: From Andreas.Baecker@gmd.de: The GINA++ application framework contains
  426. an encapsulation of the OSF/Motif widg et classes and the Xt functionality
  427. into C++ classes. Its functionality is comparab le to that of the ULowell
  428. binding and the WWL. Additionally, it provides an easy-to -use framework for
  429. modeling new composite and primitive widget classes, plus an application
  430. framework similar to ET++ or MacApp build on top of it. The binding may be
  431. used independently from the framework classes. GINA++ is available through
  432. anonymous ftp from ftp.gmd.de [129.26.8.90] in the directory /gmd/ginaplus.
  433. Documentation about the Motif binding has been published in the X Resource
  434. Journ al, Number 2, 1992, Pages 106-130. The binding compiles with AT&T C++
  435. 2.1 and GNU G+ + 2.1 and has been tested on SunOS 4.1.[12], X11R4 and Motif
  436. 1.1.3.
  437.  
  438. Answer: Motif++ is a library that defines C++ class "wrappers" for the widgets
  439. defined in the X11R5 OSF/Motif-1.2 widget library.  It also supports
  440. X11R4/Motif-1.1 as well.
  441.  
  442. Motif++ is also an application toolkit that provides other tools in
  443. conjunction with the widget wrapper classes.  It has support for the Xbae
  444. widget set, plus other widgets.  It has Imake support, and lots of test files.
  445. Motif++ also has alot of contributed software.
  446.  
  447.  
  448. Motif++ is very similar to other public domain widget libraries such as The
  449. Widget Wrapper Library (WWL) and the C++ Binding for OSF/Motif developed at
  450. the University of Lowell. The two latter libraries are the result of much
  451. larger efforts.
  452.  
  453. Availability:
  454.  
  455. Anonymous ftp at decuac.dec.com (192.5.214.1), directory /pub/X11,
  456. file motif++.28.jul.93.tar.Z
  457.  
  458. For more information, contact Ronald van Loon (rvloon@motif.hacktic.nl).
  459. There is also mailing list for Motif++. Send e-mail to
  460.  
  461. Answer: Xm++ is a user interface framework for the C++ language built upon X11
  462. and the X-Toolkit. It is designed to be a simple and intuitive programming
  463. interface to access the functionality of commonly used widgets.  Xm++ was
  464. initially created for the Motif widget set, now support for the Athena widgets
  465. was added. Applications created with Xm++ run in both environments without
  466. changes, although many nice features are only available when using Motif.
  467.  
  468. Xm++ is available on: export.lcs.mit.edu as: /contrib/Xm++.0.5.tar.Z
  469.  
  470. Answer: The Solbourne OI toolkit (not Motif) also has a C++ binding.
  471.  
  472. Answer: Liant have C++/Views.
  473.  
  474. Answer: Quest have ObjectViews.  Answer: Builder Xcessory 3.0, an interface
  475. builder from ICS, allows the user to visually build C++ classes from Motif and
  476. user-written widgets.  C++ code is generated in the "Doug Young" fashion.
  477. (Doug actually worked on this project with ICS.)  C and UIL can also be
  478. generated.
  479.  
  480. Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
  481. USA info@ics.com   617/621-0060
  482.  
  483.  
  484. Answer: Doug Young has written a book "Object Oriented Programming with C++
  485. and Motif", Prentice-Hall ISBN 0-13-630252-1 about using C++ without requiring
  486. one of these toolkits.
  487.  
  488. Answer: Unfortunately, this library (last released in 9/92) has the same name
  489. as the one by Ronald van Loon (rvloon@motif.hacktic.nl).
  490.  
  491. Motif++1.2 is a library that defines C++ class "wrappers" for the widgets
  492. defined in the OSF/Motif-1.1 widget library.  Motif++1.2 is also an
  493. application toolkit that provides other tools in conjunction with the widget
  494. wrapper classes.
  495.     One enhancement of Motif++1.2 beyond its wrapper classes are the addition
  496. of an "application" class which takes care of the low-level tasks including
  497. initializing X, creating and managing one or more top-level shells, and
  498. entering the main event loop.
  499.     Another feature of Motif++1.2 is its integration with The Widget Creation
  500. Library (Wcl).  Motif++1.2 makes it easy to initialize Wcl and create C++
  501. wrappers for desired widgets in the widget tree.
  502.     Availability: anonymous FTP at ftp.arc.umn.edu (137.66.130.11), file
  503. pub/Motif++1.2.tar.Z.  Contact Paul Felix, felix@ahpcrc.umn.edu or
  504. pfelix@vx.cis.umn.edu.
  505.  
  506. submitted by: mvc!biggers@duke.cs.duke.edu ( Mark R. Biggers )
  507.  
  508. -----------------------------------------------------------------------------
  509. Subject: 109)  How can I have a C++ member function in a callback?
  510.  
  511. [Last modified: October 93]
  512. Answer: There are three common user problems with C++ callbacks.  First, make
  513. sure you use the correct function prototype for the function declarations.
  514. Second, the callback function must be declared as a static member of the
  515. class.  Third, when registering it with XtAddCallback(), you must use its full
  516. signature.  For example: (Ken Lee klee@synoptics.com)
  517.  
  518.     class MyClass {
  519.         ...
  520.         void createWidgets();
  521.         static void myButtonCB(Widget, XtPointer, XtPointer);
  522.         ...
  523.     };
  524.     void MyClass::createWidgets() {
  525.         ...
  526.         w = XtCreatePushButton(...);
  527.         XtAddCallback(w, XmNactivateCallback, &MyClass::myButtonCB,
  528.             (XtPointer) this);
  529.         ...
  530.     }
  531.     void myButtonCB(Widget w, XtPointer clientData, XtPointer callData) {
  532.         MyClass *myclass = (MyClass *) clientData;
  533.         ...
  534.     }
  535.  
  536. Note that the "this" pointer is used as the client data.  This technique is
  537. popular, but not required.
  538.  
  539.  
  540. Motif++ has a nice tutorial summarising mechanisms (this is available
  541. separately by email from Ronald van Loon (rvloon@motif.hacktic.nl)). Doug
  542. Young's book deals extensively with one of these. The problem is that you
  543. don't get the object when you just use the function as a callback.  You need
  544. to pass the object as a pointer through as the client_data.  (use "this" as
  545. the client_data.) Then you can retrieve the object's address, and dereference
  546. from there. For example (Leo O'Donnell, Email: leo@avs.com),
  547.  
  548.     class MyButton {
  549.       public:
  550.                 MyButton (Widget parent, const char *name) {
  551.                     _button = XtVaCreateManagedWidget (
  552.                         name, xmPushButtonWidgetClass, parent, NULL, 0);
  553.                     XtAddCallback (
  554.                         _button,
  555.                         XmNactivateCallback,
  556.                         &MyButton::activateCB,
  557.                         (XtPointer) this);
  558.                 }
  559.                 ~MyButton () { XtDestroyWidget (_button); }
  560.       private:
  561.         Widget  _button;
  562.         static  void activateCB (Widget, XtPointer, XtPointer);
  563.     };
  564.  
  565.     void MyButton::activateCB (Widget, XtPointer thisBtn, XtPointer)
  566.     {
  567.         MyButton *btn = (MyButton *) thisBtn;
  568.  
  569.         // OK you've got the button instance now. Do some stuff with it!
  570.     }
  571.  
  572.  
  573.  
  574. -----------------------------------------------------------------------------
  575. Subject: 110)  Is there a Common Lisp binding for Motif?
  576.  
  577. [Last modified: November 92]
  578.  
  579. Answer: Try CLM. This includes a toolkit demon (in C) that takes a widget
  580. description (with callbacks), and forks a new process for each Motif
  581. application (which can be just a single menu, or whatever).  Lisp can then
  582. continue running, with a separate lightweight lisp process handling the
  583. connection & callbacks.  In North America & net environs, CLM-2.0beta is
  584. available from export.lcs.mit.edu.
  585.  
  586. There is also CLIM, the Common Lisp Interface Manager. It provides access to
  587. motif and other toolkits and window systems.  Here is some blurb: "Version 2.0
  588. of the Common Lisp Interface Manager (CLIM) provides access to Motif. CLIM is
  589. the emerging standard for GUI development in Common Lisp.  It offers a set of
  590. high-level facilities that enable rapid construction of user interfaces.
  591. Applications written using CLIM are portable across a variety of window
  592. systems and toolkits.  For example, on the X window System, both Motif
  593. (OSF/Motif) and Openlook (OLIT) are supported.  CLIM accesses the toolkit
  594. directly rather than emulating the look and feel."
  595.  
  596. CLIM is available from a variety of Common Lisp vendors including Symbolics
  597. and Franz Inc. (info@franz.com).
  598.  
  599.  
  600. -----------------------------------------------------------------------------
  601. Subject: 111)* Is there an Ada binding for Motif?
  602.  
  603. [Last modified: Apr 94 ]
  604.  
  605. Answer:
  606.  
  607. Answer:  Integrated Computer Solutions, Inc. (ICS) supplies Ada bindings to
  608. Motif for a number of platforms and Ada compilers.  ICS also provides Builder
  609. Xcessory, a Motif interface builder, which outputs Ada code usable with the
  610. Ada bindings.  The product family is known collectively as the Ada Xcessories.
  611.  
  612. Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
  613. USA info@ics.com   617/621-0060
  614.  
  615.  
  616.  
  617. Information on Ada bindings to Motif and other services (such as SQL and
  618. POSIX) can be found in a document maintained by the Ada Information
  619. Clearinghouse.  The report can be found at
  620.  
  621.         host:   ajpo.sei.cmu.edu
  622.         loc:    /public/ada-info/bindings.hlp.*
  623.         access: anonymous ftp
  624.  
  625. The suffix to the file (indicated above with an asterix) is the date of the
  626. latest update to the document.  For example, the full name of the report
  627. updated on 14 June 1993 would be
  628.  
  629.         /public/ada-info/bindings.hlp.14Jun93.
  630.  
  631. The file is ASCII.
  632.  
  633. ------ Included File
  634.  
  635.  
  636. [...Excerpted from the AdaIC report bindings.hlp.14Jun93...]
  637. [...Updates can be found on ajpo.sei.cmu.edu, in the    ...]
  638. [...file /public/ada-info/bindings.hlp.*  The suffix    ...]
  639. [...is always the date of the lastest version to the    ...]
  640. [...report.                                             ...]
  641.  
  642.                                      SECTION 12
  643.                                   X-Window System:
  644.                                OSF Motif and Open Look
  645.                                Available Ada Bindings
  646.  
  647.  
  648. 12.1  Description and Standardization Efforts
  649.  
  650. The X-Window System is a network-transparent window system.  It supports one
  651. or more screens containing overlapping windows or subwindows.  X display
  652. servers distribute user input to and accept output requests from various
  653. client programs located either on the same machine or elsewhere in the
  654. network.
  655.  
  656.             OSF Motif (Open Software Foundation/Motif) is a graphical user
  657.             interface from OSF that provides a Presentation Manager look and
  658.             feel for applications running on any system with X Window version
  659.             11.  It conforms to POSIX, ANSI C and X/Open's XPG3 standards.
  660.  
  661. 12.2  Resources Available from Software Reuse Libraries/Repositories
  662.  
  663.  
  664. ASSET                                                      (Updated:  November
  665. 1 992)
  666.  
  667. The following information was taken in its entirety from the ASSET Library
  668. Repository Catalog, October 9, 1992.  For more information on ASSET, see
  669. Appendix C.
  670.  
  671.  
  672. INTERFACE TO THE X WINDOW SYSTEM
  673.  
  674. VERSION_NUMBER    : 1.1
  675. DEVELOPED_BY      : SAIC
  676. RELEASE_DATE      : 29-SEP-88
  677. UNIQUE_IDENTIFIER : ASSET_A_240
  678. ALTERNATE_NAME    : SAICX2
  679. ASSET_TYPE        : SOFTWARE CODE
  680. FUNCTIONS         : INTERFACE, BIND
  681. OBJECTS           : ADA, X WINDOWS
  682. KEYWORDS          : STANDARDS, BINDINGS
  683. COLLECTION        : STARS FOUNDATIONS
  684. DISTRIBUTION      : UNLIMITED
  685.  
  686. DESCRIPTION       :
  687.  
  688. Interface to the X Window System
  689.       An expression of the various concepts in Ada that provides a full,
  690. working Ada specification of the X Window system.
  691.      Approved for public release; distribution is unlimited.
  692.  
  693. 12.3  Products Available from Vendors
  694.  
  695.  
  696. Advanced Technology Center                                 (Updated:  November
  697. 1 992)
  698.  
  699. The Advanced Technology Center (ATC) has an Ada binding to OSF Motif for their
  700. AXI~ product.  AXI is currently available for most UNIX-based platforms, and
  701. is supported by Verdix, Meridian, and TeleSoft compilers.
  702.  
  703. AXI is an Ada-to-X-Window System interface that provides the Ada programmer
  704. access to the 500+ functions, libraries, and procedures contained in the X
  705. library (Xlib), the X Toolkit (Xt), the X Extensible Library, the X
  706. Miscellaneous Utilities, the Motif widget set and the Motif Resource Manager.
  707.  
  708. ATC is planning to develop an Ada binding to Open Look for AXI.
  709.  
  710. For more information, contact:Larry Paulson, Advanced Technology Center, 22982
  711.                         Mill Creek Drive, Laguna Hills, CA  92653, USA; Phone:
  712.                         714-583-9119
  713.  
  714.  
  715. Alsys, Inc.                                                     (Updated:  May
  716. 1 992)
  717.  
  718. The Alsys Ada Software Development Environment (Alsys's validated Ada compiler
  719. #901221W1.11103) for 386 UNIX is a production-quality Ada environment capable
  720. of handling very large Ada applications (over 500,000 lines of code).  The
  721. product includes the Compiler; Multi-Library Environment, which provides a
  722. powerful and flexible way to manage Ada development effort and share program
  723. units; Binder, which supports unused subprograms elimination; High-and Low-
  724. Level Optimizers for improving code quality and performance; and Run-Time
  725. Executive for efficient support for executing Ada programs.  Also included is
  726. the Developer's Toolset including:  Ada Probe, a symbolic source level
  727. debugger and program viewer; AdaXref, a cross-reference generator; AdaMake, a
  728. recompilation aid; AdaReformat, a source reformatter.
  729.  
  730. Alsys currently has Ada bindings to POSIX, X-Windows (OSF Motif), and the
  731. Generic Package of Elementary Functions for the Alsys Ada Software Development
  732. Environment, running on 386 UNIX 386/486-based machines supported as both host
  733. and target and running 386/ix or SCO UNIX.  They are also planning a binding
  734. to SQL for  386/486 machines.
  735.  
  736. Host/Target:386/486 PC under IX UNIX, 386/486 PC under SCO UNIX
  737.  
  738. The Alsys Ada Software Development Environment for the IBM RS/6000 is a
  739. production-quality Ada environment capable of handling very large Ada
  740. applications.  Hosted on and targeted to the IBM RS/6000 workstation under
  741. IBM's AIX operating system, the product includes the Compiler; Multi-Library
  742. Environment, which provides a  powerful and flexible way to manage Ada
  743. development efforts and share program units; Binder; Run-Time Executive; and
  744. both a High and Low-Level Optimizer for improving code quality and
  745. performance.  Also included is the Alsys Ada Toolset including Ada Probe,
  746. symbolic source level debugger and program viewer; AdaXref, cross-reference
  747. generator; AdaMake, recompilation aid; and AdaReformat, source reformatter.
  748.  
  749. Alsys has bindings currently available to the Generic Package of Elementary
  750. Functions and to X-Windows (OSF Motif) for the Alsys Ada Development
  751. Environment for the IBM RS/6000 running on any RISC System/6000 machine as
  752. both host and target and running IBM's AIX operating system (Alsys's validated
  753. Ada compiler #910809W1.11195).   Alsys also plans to develop a POSIX binding
  754. for the RS/6000.
  755.  
  756. Host/Target:RISC System/6000 under AIX
  757.  
  758. The Alsys Ada Software Development Environment for SPARC Workstations is a
  759. production-quality Ada environment capable of handling very large Ada
  760. applications.  Hosted on any SPARC-based workstation under SunOS or SunView,
  761. the product helps you realize the full potential of Ada on SPARC machines. The
  762. product includes the Compiler (with High- and Low-Level Optimizers); Binder,
  763. which supports unused subprogram elimination; Multi-Library system (Family,
  764. Library, and Unit Managers) which provides a powerful and flexible way to
  765. manage Ada development efforts and share program units;  AdaExec real-time
  766. executive, for complete and efficient support for executing Ada programs; and
  767. ISO-standard mathematical library.  Also included is the Alsys Ada Toolset
  768. including AdaProbe, symbolic source level debugger and program viewer;
  769. AdaXref, cross-reference  generator; AdaMake, recompilation aid; and
  770. AdaReformat, source reformatter.
  771.  
  772. Bindings to the Generic Package of Elementary Functions and to OSF/Motif are
  773. currently available for the Alsys Ada Software Development Environment running
  774. on any SPARC-based Workstation as both host and target and running SunOS or
  775. SunView.
  776.  
  777. Host/Target:SPARC under SUNOS
  778.  
  779. For more information, contact:Scott Garren, Alsys, Inc., 67 South Bedford
  780.                         Street, Burlington, MA  01803-5152, USA;  Phone:
  781.                         (617) 270-0030
  782.  
  783.  
  784. Digital Equipment Corporation                              (Updated:  November
  785. 1 992)
  786.  
  787. Digital Equipment Corporation has bindings available for GKS, PHIGS, SQL, and
  788. OSF Motif for VAX Ada/VMS.  The Ada bindings are provided either as part of a
  789. compiler product or the services/facilities that are provided by Digital and
  790. its suppliers.
  791.  
  792. Host/Target:DEC VAX under VMS
  793.  
  794. For more information, contact:Mary Anne Cacciola, Digital Equipment
  795.                         Corporation, 110 Spit Brook Road, Nashua, NH  03062,
  796.                         USA; Phone:  (603) 881-1028
  797.  
  798.  
  799. IBM                                                        (Updated:  November
  800. 1 992)
  801.  
  802. IBM's AIX Ada/6000 product provides a binding to GPEF and IBM AIXWindows (X-
  803. Windows ... not Motif).  It runs on all models of the IBM RISC System/6000
  804. under the IBM AIX Version 3.2 operating system. See also entries for Systems
  805. Engineering Research Corporation (SERC) and Advanced Technology Center (ATC)
  806. for Motif, GKS or PHIGS bindings for use with IBM AIX Ada/6000 products.
  807.  
  808.  
  809. The AIX Ada/6000 licensed programs (5706-291 and 5706-294) consist of an
  810. optimizing compiler, a run-time environment, a symbolic debugger, an Ada
  811. "makefile" generator for use in automating and minimizing recompilation, Ada
  812. library management tools and Ada language bindings to some key AIX subsystems.
  813. With the exception of some system-specific aspects of the language, the Ada
  814. language for the AIX operating system is source compatible with the Ada
  815. language supported by IBM licensed programs in VM/CMS and MVS.
  816.  
  817. Host/Target:IBM RISC System/6000 under the IBM AIX Version 3.2 operating
  818.             system
  819.  
  820. This product conforms to the following standards:  ANSI/MIL-STD-1815A - Ada at
  821. current level (1.11) of the ACVC test suite.
  822.  
  823. For more information, contact:Barry Lee, IBM Corporation, 844 Don Mills Road,
  824.                         North York, Ontario, Canada  M3C 1V7; Phone:  (416)
  825.                         448-3174; Fax: (416) 448-4810
  826.  
  827. Objective Interface Systems, Inc.                          (Updated:  November
  828. 1 992)
  829.  
  830. Objective Interface Systems, Inc., has an Ada binding to X-windows (OSF Motif)
  831. for its Screen Machine~ product.  The Screen Machine binding to Motif includes
  832. a WYSIWYG drawing tool and an Ada code generator.
  833.  
  834. Host/Target:
  835.  
  836.       Sun SPARC/SunOS         Rational R1000/Delta    HP 9000/7XX; 8X7
  837.       IBM RISC System/6000/AIXPC 386/486/ISC UNIX     HFSI WIS Workstation
  838.       PC 286/386/486/MS-DOS   PC 386/486/SCO UNIX     DEC Ultrix; DEC VMS
  839.  
  840. For more information, contact:Phil Carrasco, Object Interface Systems, Inc.
  841.                         1895 Preston White Drive, Suite 250, Reston, VA
  842.                         22091-5448, USA; Phone: (703) 264-1900; Fax:
  843.                         703-264-1721; email info@ois.com (internet)
  844.  
  845.  
  846. SL Corporation                                              (Updated: November
  847. 1 992)
  848.  
  849. SL Corporation's SL-GMS toolkit includes Ada bindings to GPEF, GPPF, POSIX,
  850. SQL, TCP/IP, OSF/Motif, and Open Look.
  851.  
  852. SL-GMS is a toolkit for developing dynamic graphics screens for real-time or
  853. highly interactive applications.  Non-programmers can design application
  854. screens in a standard drawing-tool mode, connect them to real-time data
  855. sources and animate screen objects to visualize changing data values.  SL-GMS
  856. allows the design of custom "GISMOs" to input values or control the
  857. application and supports MOTIF, OPEN LOOK and other X toolkit widgets.
  858.  
  859. SL-GMS is used extensively to provide real-time graphics for applications in
  860. the fields of manufacturing, process control, network management, avionics and
  861. financial tracking.
  862.  
  863. Host/Target:Validated Verdix and DEC compilers support SL-GMS for the
  864.             following machines as both host and target:
  865.  
  866.  
  867.       DEC-DECstation/ULTRIX 4.0DEC-VAXstation/ULTRIX 4.0
  868.       DEC-VAXstation/VMS 5.4  DEC-VAXstation/VMS 5.5
  869.  
  870.       IBM-RS6000/AIX
  871.  
  872.       HP-9000/300/UNIX        HP-9000/400/UNIX
  873.       HP-9000/800/UNIX        HP-9000/700/UNIX
  874.  
  875.       PC-386/IX UNIX          PC-386/SCO UNIX
  876.       PC-386/Lynx             PC-386/0S2
  877.       PC-386/System 5.4
  878.  
  879.       SGI-4D/IRIX 3.3
  880.  
  881.       Sun-3/SunOS 4.1         SunSPARC/SunOS 4.1
  882.  
  883.       88 Open/BCS Compliant
  884.  
  885. For more information, contact: Mike Meagher, SL Corporation, 240 Tamal Vista
  886.                         Boulevard, Corte Madera, CA  94926, USA Phone: (415)
  887.                         927-1724; Fax: (415) 927-2931
  888.  
  889.  
  890. Sunrise Software International                                  (Updated:  May
  891. 1 992)
  892.  
  893. Sunrise Software International's product, ezx, is a rapid application
  894. development tool that automates the creation of graphical user interfaces for
  895. OSF/MOTIF and generates C, UIL, or Ada.  ezx provides WYSIWYG screen layout;
  896. color, font and pixmap editors; presentation tools and dialog management.  A
  897. prototype can be developed in hours and using a script language similar to
  898. Hypertalk, demonstrated to end-users before the first line of code is written.
  899. Then portable C, UIL or Ada can be generated automatically.  Ada bindings are
  900. provided.  The total code required to develop a GUI is reduced by
  901. approximately 75%.   The appearance and behavior of the GUI is defined in an X
  902. resource file which the application loads at run time.  This provides explicit
  903. separation between the GUI and the computational core of the application. Thus
  904. the GUI can be revised without recompiling (and retesting) the application.
  905.  
  906. ezx provides cost savings throughout the software development cycle, from
  907. requirements analysis through design, code, test and maintenance.
  908.  
  909.  
  910. Host/Target:DEC RISC under ULTRIX, DEC VAX under VMS, IBM 386 under UNIX, IBM
  911.             RS 6000 under AIX, SGI under , SUN SPARC under UNIX
  912.  
  913. For more information, contact:Frederick Sells, Sunrise Software International,
  914.                         170 Enterprise Center, Middletown, RI  02840, USA;
  915.                         Phone:  401-847-7868
  916.  
  917. Systems Engineering Research Corporation (SERC)            (Updated:  November
  918. 1 992)
  919.  
  920. SERC's Ada/MOTIF is a complete binding to X Window and OSF/Motif for the Ada
  921. programming language that was based in part upon the SAIC/Unisys (STARS)
  922. public domain bindings.  That work was leveraged as a starting point for this
  923. development; many of the bug fixes and additional capabilities beyond the
  924. public domain releases in Ada/MOTIF have been incorporated.  Most noteworthy
  925. are the capabilities included in Ada/Motif for Ada tasking, callback
  926. registration, memory leak detection/prevention and capabilities for developing
  927. customized widgets.  Paramax/STARS considers Ada/Motif to be the commercial
  928. version of their STARS bindings, according to SERC.
  929.  
  930. Ada/MOTIF is supported by the ALSYS, VERDIX, SUNAda, IBM Ada, and SGI Ada
  931. compilers.
  932.  
  933.  
  934. Host/Target:SUN 4, HP 300/400, HP 700, IBM RS 6000, SGI, 386
  935.             SUN OS 4.1.1, SOLARIS 2.0 (coming), HPUX 8.0, SGI 3.2 & 4.0, IBM
  936.             ATX 3.2, SCO 3.2
  937.  
  938. For more information, contact:Theo Kusiolek or Scott Cleveland, Systems
  939.                         Engineering Research Corporation (SERC), 2555
  940.                         Charleston Road, Mountain View, CA  94043, USA; Phone:
  941.                         800-ADA-SERC or 415/962-9092; Fax:  415/962-0330;
  942.                         E-mail:  Well!sercmail@apple.com.
  943.  
  944.  
  945. TeleSoft                                                   (Updated:  November
  946. 1 992)
  947.  
  948. TeleSoft's TeleUSE/Ada automates the creation of OSF/Motif graphical user
  949. interfaces for Ada applications.  It includes a special version of the TeleUse
  950. User Interface Management System -- which generates Ada source code -- and Ada
  951. bindings to the TeleUSE run-time routines.
  952.  
  953. TeleUse/Ada tools allow a GUI to be prototyped and designed using a WYSIWYG
  954. editor and a PDL, and also includes tools for debugging, generating production
  955. code and maintaining the GUI.  TeleUse/Ada can save the developer up to 90
  956. percent of the time required to hand code X Window System GUIs.
  957.  
  958. Host/Target:SPARC under UNIX, Sun-4 under UNIX
  959.  
  960.  
  961. TeleSoft's TeleWindows is a set of Ada bindings to the X Window System and
  962. OSF/Motif.  This includes Xlib, XT, X extensions Library, XT+, X miscellaneous
  963. utilities, Motif widget set, XM, MWM, Motif resource manager.  It supports X-
  964. 11 R4 and is not based on the public domain version.  It closely follows the C
  965. Xlib syntax and allows Ada applications to co-exist with C applications.
  966.  
  967. Host/Target:IBM System/370 under VM/CMS
  968.  
  969. For more information, contact:Karen Johnson, TeleSoft, 5959 Cornerstone Court
  970.                         West, San Diego, CA  92121-9891, USA; Phone:  (619)
  971.                         457-2700
  972.  
  973. Verdix                                                          (Updated:  May
  974. 1 992)
  975.  
  976. The Verdix Ada Development System (VADS), is a complete Ada Compiler System
  977. offering a fully validated Ada compiler with chapter 13 support.  Verdix
  978. supplies VADSself and VADScross.   VADSself provides a complete toolset for
  979. self-targeted applications.  It easily interfaces to databases, windowing
  980. systems and program management tools.  VADScross provides real-time support
  981. for host-to-target system development.  VADScross produces small and fast
  982. object code.  VADS is hosted on the largest number of platforms and targets
  983. the greatest number of microprocessors.
  984.  
  985. Host/Target:88000 BCS under UNIX, DEC VAX under VMS / ULTRIX / UNIX,
  986.             DECStation (RISC) under UNIX, DECSystem (RISC) under UNIX, HP 9000
  987.             Series 300 under HP-UX  (UNIX), IBM PS/2 under AIX  (UNIX), IBM
  988.             RISC System/6000 under AIX, SCO Systems V/386 (ABI) under UNIX,
  989.             Sun SPARC systems under UNIX, Sun-3 systems under UNIX
  990.  
  991. Verdix AXI provides an Ada binding to the full Motif, Xt, and Xlib libraries.
  992. The product works with user-supplied Motif 1.1 and X11R4 libraries regardless
  993. of source.
  994.  
  995. Host/Target:DEC RISC under Ultrix, IBM RS6000 under AIX, MIPS under MIPSos,
  996.             Sun-4 under SunOS, Sys V386 under ISC UNIX, Sys V386 under SCO
  997.             UNIX
  998.  
  999. For more information, contact:Tim Ruhe, Verdix Corporation, 205 Van Buren,
  1000.                         Herndon, VA  22070, USA; Phone:  (703) 318-5800
  1001.  
  1002. Answer: Integrated Computer Solutions, Inc. (ICS) supplies Ada bindings to
  1003. Motif for a number of platforms and Ada compilers.  ICS also provides Builder
  1004. Xcessory, a Motif interface builder, which outputs Ada code usable with the
  1005. Ada bindings.  The product family is known collectively as the Ada Xcessories.
  1006.  
  1007. Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
  1008. USA info@ics.com   617/621-0060
  1009.  
  1010.  
  1011.  
  1012. -----------------------------------------------------------------------------
  1013. Subject: 112)  Is there a Poplog binding for Motif?
  1014.  
  1015. [Last modified: May]
  1016.  
  1017. Answer:
  1018.  A integrated programming environment consisting of the programming
  1019.     languages Pop-11, Prolog, Standard ML, and Lisp which are compiled
  1020.     to machine code via a common virtual machine. Pop-11 provides a rich
  1021.     interface to the X Toolkit which can be accessed from all other
  1022.     Poplog languages. The OLIT, Motif, and Athena widget sets are
  1023.     supported, in addition to the custom Poplog (Xpw) widget set. XVed
  1024.     provides a sophisticated, customisable multi-window editor. Under
  1025.     OPEN LOOK and Motif the Poplog User Interface (PUI) provides a
  1026.     graphical interface to the Poplog system. High-level Pop-11
  1027.     libraries allow graph drawing, turtle graphics, and the simple
  1028.     creation of basic button/menu based interfaces.
  1029.  
  1030. Contact:
  1031.  
  1032.     UK EDUCATION SITES:
  1033.         Poplog Sales. School of Cognitive and Computing Sciences.
  1034.         Brighton. BN1 9QN. England.
  1035.         Phone: +44 (0)273 678188
  1036.         Email: popsales@cogs.susx.ac.uk
  1037.     USA AND CANADIAN EDUCATION SITES:
  1038.         Computable Functions Inc. 35 South Orchard Drive. Amherst.
  1039.         MA 01002. USA.
  1040.         Phone: (413) 253-7637
  1041.     ALL OTHER SALES:
  1042.         Integral Solutions Ltd. Unit 3, Campbell Court. Bramley.
  1043.         Basingstoke. Hampshire. RG26 5EG. England.
  1044.         Phone:  +44 (0)256 882028
  1045.         Fax:    +44 (0)256 882182
  1046.         Email:  isl@integ.uucp
  1047.  
  1048.  
  1049.  
  1050. -----------------------------------------------------------------------------
  1051. Subject: 113)  TOPIC: SPECIFIC PLATFORMS
  1052.  
  1053. -----------------------------------------------------------------------------
  1054. Subject: 114)  Is it easy to build Motif for a Sun?
  1055.  
  1056. Answer: See next question for Solaris 2.  No pattern has emerged to problems
  1057. about compiling Motif on the Sun (although people seem to have a lot of
  1058. different minor problems), and many reports are that it is straightforward.
  1059. Read the Motif install instructions (which often have specific reference to
  1060. Sun installation), light the blue touch paper and just standback. [My
  1061. experience was that I had to add -D_NO_PROTO for 1.1 on a Sparc OS 4.1, and
  1062. that was all.  Others have added STRINGS_ALIGNED and NO_REGEXP].
  1063.  
  1064.  
  1065. -----------------------------------------------------------------------------
  1066. Subject: 115)  How do I build Motif 1.2.2 on Solaris 2.1 with Sun C?
  1067.  
  1068. [Last modified: May 93]
  1069.  
  1070. Prepared by Ric Steinberger.  ric@updike.sri.com  4/09/93
  1071.  
  1072. What follows is a description of the steps I used to build Motif 1.2.2 on a
  1073. SUN IPX running Solaris 2.1.  Sun's C compiler (2.0.1) was used.  Many thanks
  1074. go to Kaleb Keithley (kaleb@devvax.jpl.nasa.gov) for several useful
  1075. suggestions.  Other people, including OSF staff, especially David Brooks
  1076. (dbrooks@osf.org), helped as well.  My thanks to you all.
  1077.  
  1078. 1. Build X11R5 from the mit distribution.  You need to retrieve the sources
  1079.    from export.lcs.mit.edu (in pub/R5) and patches 1 - 22 (or 23) (in
  1080.    pub/R5/fixes).  There are several other sites that contain the X11R5
  1081.    sources.  After installing patch 19, apply PEXlib.tar.Z, also available
  1082.    from export.lcs.mit.edu in pub/R5/fixes.  You can apply also
  1083.    R5.Xsun.multi-screen and R5.SunOS5.patch.  There are .README files
  1084.    that explain how to patch.  Be SURE to read
  1085.    R5.SunOS5.patch.README for details on how to BUILD X11.  You probably
  1086.    want to use the ProjectRoot feature in the site.def file in the
  1087.    mit/config directory.  You will NEED to edit that file to do that.
  1088.  
  1089. 2. Obtain the Motif 1.2.2 distribution from OSF (617-621-7300).  You may
  1090.    need to first install the 1.2 tape, then the 1.2.1 and finally the
  1091.    1.2.2 tape.  You might want to do a "chmod -R u+w ." after unloading
  1092.    each tape.
  1093.  
  1094. 3. In the config directory, there are several changes.  Some of the changes
  1095.    are based on R5.SunOS5.patch files.  A complete set of config files
  1096.    relevant to Solaris have been placed in the anon-ftp account of
  1097.    updike.sri.com in pub/motif/solaris21-motif122-config.tar.Z.  They are
  1098.    also available from OSF on their mail response server (available to
  1099.    support contract holders) and they will send them directly to full
  1100.    support contract holders.  Decompress and untar this file in your Motif
  1101.    config subdirectory.  Copy site.def.sample to site.def, then edit
  1102.    site.def.  You will probably want to uncomment the ProjectRoot section
  1103.    and use the same value used in your X11R5 build.  Also, you will probably
  1104.    want to use /usr/ucb/install in you installed the UCB compatibility
  1105.    suite.  Otherwise you might want to use the install supplied at the end
  1106.    of this memo.  [I used the UCB version and can't swear that this works.
  1107.    Bit it should.  Put it someplace like /usr/local/bin and chmod +x it.]
  1108.  
  1109.    There are two patches to consider.  One fixes a cursor problem
  1110.    in ./lib/Xm/TextF.c.  The other removes a Berkeleyism.  These
  1111.    patches should probably be consider unofficial at present.
  1112.    Failure to deal with the Berkeleyism (bzero) means you will need to
  1113.    link with -lucb -lelf.  This will probably work, but why bother?
  1114.    Furthermore, if you move the Motif binaries to a machine without
  1115.    the ucb compatability suite, you won't have the sharable libs you need.
  1116.  
  1117. [The actual patches have been censored because they contain OSF source code]
  1118.  
  1119.    Patch 1: In TextF.c there are several places _XmTextFieldDrawInsertionPoint
  1120. is called. These should be moved two or three lines further down *after* the
  1121. "if (!XtIsRealized(tf)) return True;" statement.
  1122.  
  1123.  
  1124.    patch 2: The call to bzero in lib/Xm/Visual.c should be replaced by the
  1125. equivalent call to memset
  1126.  
  1127.  
  1128.     Both these patches can be applied in the ./lib/Xm directory.
  1129.     If you don't have the patch program (how did you build X11?),
  1130.     you can get it in the vendor/cygnus directory of ftp.uu.net,
  1131.     or you can build it from source.  Be sure to get the latest
  1132.     version (2.0.12.u8).
  1133.  
  1134. 4) Use the README-1.2.1 file as a guideline for building motif.  I followed
  1135.    directions in the section called, "Using X11R5 Installed Libraries
  1136.    and Header Files."  If you make a mistake after your first build
  1137.    attempt, copy Makefile.ini to Makefile before retrying.  You may
  1138.    need to do this in the config subdirectory too, depending on what
  1139.    went wrong.
  1140.  
  1141. 5) After make Makefiles, do make includes, make depend, then make (or
  1142.    as OSF recommends, make -k).  This gets as far as motifshell in the
  1143.    demos, which fails to build because O_RDONLY and L_XTND are
  1144.    not defined.  O_RDONLY is in fcntl.h (actually <sys/fcntl.h>, but
  1145.    fcntl.h includes this.)  L_XTND can be replaced by SEEK_END.
  1146.    SEEK_END is in stdio.h.  These two fixes will allow motifshell to build.
  1147.    Note: many MANY compiler warning messages will be generated during
  1148.    the build process.
  1149.  
  1150. 6) You can go to the demos/xmsamplers directory and do a make there.
  1151.    Other demos may build, or not depending on whatever. . . .
  1152.  
  1153. 7) make install will do the install.  [It will fail at motifshell
  1154.    if you don't fix it, as mentioned above.]  You can do a make install
  1155.    in demos/xmsamplers if you want these.
  1156.  
  1157. 8) If running on a SUN (as opposed to an X term), you will (probably) need
  1158.    to start openwin with something like:
  1159.  
  1160.         openwin -server /usr/X11R5/bin/Xsun
  1161.  
  1162.  
  1163.    [You might want to use an alias for this.]
  1164.    This fixes an annoying problem: The mouse keys stop working after you
  1165.    click on an icon to get the icon menu (on SUNs only, not X terms).
  1166.    The ALT keys still work, if you get stuck.  I don't know whether this
  1167.    is a bug in SUN's server or whether it is Motif related.
  1168.  
  1169.    Here is a copy of my .xinitrc:  It's not elegant.  Sun's default
  1170.    openwin startup file is in: /usr/openwin/lib/Xinitrc.  You can
  1171.    copy this to ~/.xinitrc and customize as desired.  Obviously, the
  1172.    default behavior is to start the OpenLook environment (boo!).
  1173.  
  1174.  
  1175. #!/bin/sh
  1176. #
  1177. # .xinitrc - OpenWindows startup script.
  1178. #
  1179. if [ -f $HOME/.Xdefaults ]; then
  1180.     xrdb $HOME/.Xdefaults              # Load Users X11 resource database
  1181. fi
  1182. if [ -f $HOME/.Xdefaults.sun ]; then
  1183.     xrdb -merge $HOME/.Xdefaults.sun
  1184. fi
  1185. DISPLAY=`hostname`:0.0
  1186. export DISPLAY
  1187. xhost + > /dev/null
  1188. #xterm -sb -sl 512 -T `hostname` -ls -n `hostname` &
  1189. xterm -sb -sl 512 -T `hostname` -n `hostname` &
  1190. mwm &
  1191. xclock -geometry +1010+0 &
  1192. xload -geometry +710+5 -fg red &
  1193. xsetroot -solid salmon &
  1194. xterm -sb -sl 100 -T CONSOLE_DO_NOT_LOGOUT -C -n console -iconic
  1195. #wait
  1196.  
  1197. Here's .Xdefaults.sun, which gives me a more readable font for use with
  1198. motif on Sun monitors:
  1199.  
  1200. !Some additional .Xdefaults values specifically for SUN
  1201. !
  1202. ! After loading .Xdefaults, xrdb -merge .Xdefaults.sun
  1203. !
  1204. Mwm*fontList:           8x16
  1205. !Mwm*fontList:          vtbold
  1206. !Change as desired.
  1207.  
  1208.  
  1209.      You will probably want to maintain LD_LIBRARY_PATH to something like:
  1210. /opt/SUNWspro/lib:/usr/ccs/lib:/usr/ucblib:/usr/X11R5/lib:/usr/lib:
  1211. /usr/openwin/lib.  If you use emacs, you will need to leave /usr/openwin/lib
  1212. there.  [This is because you probably, like me, used the distributed version
  1213. of s-sol2.h, which explicitly refers to windowing libraries as being in the
  1214. /usr/openwin locations.  Yes, I know that emacs/Solaris ought to allow
  1215. LibXt.so.N.M to be "picked up" from elsewhere, like /usr/X11R5/lib, but the
  1216. one emacs links with is LibXt.so.4.something, and the mit one is
  1217. LibXt.so.5.something.  So it seems to want the .4 one.  Any comments?  I'd
  1218. prefer not to rebuild emacs based on the X11R5 libs because I occassionally
  1219. need to move the emacs binaries to machines without the mit files.]
  1220.  
  1221. -----------------------------------------------------------------------------
  1222. Subject: 116)  What compile errors/warnings might I get in both Sun 3 and Sun
  1223. 4?
  1224.  
  1225. Answer:
  1226.  
  1227.  
  1228. make: Warning: Too many rules defined for target
  1229. make: Warning: Too many rules defined for target
  1230. "callbacks.c", line 1530: warning: illegal combination of pointer
  1231. and integer, op =
  1232. "callbacks.c", line 1531: warning: illegal combination of pointer
  1233. and integer, op =
  1234. "callbacks.c", line 1532: warning: illegal combination of pointer
  1235. and integer, op =
  1236. "utils.c", line 73: warning: illegal combination of pointer and integer, op =
  1237. "utils.c", line 74: warning: illegal combination of pointer and integer, op =
  1238. "utils.c", line 122: warning: illegal combination of pointer and integer, op =
  1239. "utils.c", line 123: warning: illegal combination of pointer and integer, op =
  1240. "utils.c", line 191: warning: illegal combination of pointer and integer, op =
  1241. "utils.c", line 194: warning: illegal combination of pointer and integer, op =
  1242. "utils.c", line 195: warning: illegal combination of pointer and integer, op =
  1243. "utils.c", line 196: warning: illegal combination of pointer and integer, op =
  1244. "utils.c", line 316: warning: illegal combination of pointer and integer, op =
  1245. "utils.c", line 334: warning: illegal combination of pointer and integer, op =
  1246. "utils.c", line 338: warning: illegal combination of pointer and integer, op =
  1247. "utils.c", line 341: warning: illegal combination of pointer and integer, op =
  1248. "xmdialogs.c", line 838: warning: illegal combination of pointer
  1249. and integer, op =
  1250. "xmeditor.c", line 1152: warning: illegal combination of pointer
  1251. and integer, op =
  1252.  
  1253. These warning messages can be ignored. OSF is aware of these warnings.
  1254.  
  1255.  
  1256. -----------------------------------------------------------------------------
  1257. Subject: 117)  On a Sun 3, what are the mwm startup error messages about?  I
  1258. get
  1259.  
  1260. mwm: Invalid accelerator specification on line 7 of
  1261.      specification string
  1262. mwm: Invalid accelerator specification on line 31 of
  1263.       configuration file
  1264.  
  1265.  
  1266. Answer: This is because some Sun keyboards do not have an F10 key and some sun
  1267. workstations which have an F10 key do not have X-servers which recognize it.
  1268. The F10 key is used by mwm.  If the machine does have an F10 key, the user
  1269. should use xmodmap to tell the server it exists.  Otherwise, change the
  1270. definition of the DefaultWindowMenu in /usr/lib/X11/system.mwmrc (after
  1271. installation) or in /lib/clients/mwm/system.mwmrc (before installation).
  1272. Change the accelerator of "Maximize" (it is "Alt<Key>F10)" to something else.
  1273. Also, you should change the definition of DEFAULTSYSTEMMENU in the file
  1274. /clients/mwm/WmResource.c in a similar fashion.  There is as yet no standard
  1275. redefinition for F10.
  1276.  
  1277.  
  1278.  
  1279. -----------------------------------------------------------------------------
  1280. Subject: 118)  Are there problems making shared libraries on a Sun?
  1281.  
  1282. Answer: If you use the -pic option you may run out of offset table space.  use
  1283. the -PIC option instead.
  1284.  
  1285. You may get the message "ld.so: Undefined symbol: __XtInherit" when executing
  1286. UIL. There is a problem in shared library build when you compare a function
  1287. variable to a routine name, but don't call the routine.  Either, you can build
  1288. the Xt library nonshared, or you can put a reference to XtToolkitInitialize in
  1289. the UIL main program (or even include a module that references it).  The
  1290. routine doesn't even have to be called; it just has to be there.
  1291.  
  1292.  
  1293. -----------------------------------------------------------------------------
  1294. Subject: 119)  The OpenWindows server hangs when I popup a menu with Button 3.
  1295. [Last modified: August 92]
  1296.  
  1297. Answer: This is an OpenWindows problem, but if you have Motif source you can
  1298. fix your own applications. From Steve Sistare of Thinking Machines Corp.:
  1299. "Change the 2 calls to XtGrabButton in RowColumn.c such that ButtonReleaseMask
  1300. | ButtonPressMask is passed for the event mask.  Currently, only
  1301. ButtonReleaseMask is passed.  Also, change the owner_event argument to FALSE.
  1302. " This has not been fixed in Motif as at 1.1.5.
  1303.  
  1304. -----------------------------------------------------------------------------
  1305. Subject: 120)  Has anyone made shared libraries on an IBM RS/6000?
  1306.  
  1307. Answer: From Sakari Jalovaara: There is a problem: Xm redefines VendorShell
  1308. and the AIX linker put _both_ Xm's and Xt's VendorShell into programs.  When
  1309. an AIX shared library is created as many references inside the library are
  1310. resolved as possible.  If the symbol vendorShellClassRec is defined in libXt
  1311. and referenced, say, from a function XtFoo() also in libXt, the "ld" run that
  1312. creates the shared library resolves the reference:
  1313.  
  1314.         XtFoo() -> vendorShellClassRec
  1315.  
  1316. Then I create the Motif library that has its own vendorShellClassRec and an
  1317. XmBar() function that uses it; libXm will also contain a resolved reference to
  1318. vendorShellClassRec:
  1319.  
  1320.         XmBar() -> vendorShellClassRec
  1321.  
  1322. Finally, I link a program that uses both XtFoo() and XmBar() and the program
  1323. will end up with _two_ independent "vendorShellClassRec"s:
  1324.  
  1325.         XtFoo() -> vendorShellClassRec [Xt version]
  1326.         XmBar() -> vendorShellClassRec [Xm version]
  1327.  
  1328. Instant schizo zaphod mode.  In reality, vendorShellClassRec is not referenced
  1329. from functions but from other widget class records.
  1330.  
  1331. I can't just pull Vendor.o out from the shared Xt (Vendor.o appears to define
  1332. the only external symbols redefined by libXm) because AIX shared libraries
  1333. apparently can't contain unresolved external references.  If I take out
  1334. Vendor.o I have to take out every other file that uses symbols defined there -
  1335. and then files that need those files, etc.  I tried it and ended up with three
  1336. or four object files in libXt and the res non-sharable.
  1337.  
  1338. I kludged around this by putting all of libXt (minus Vendor.o) into the shared
  1339. libXm.  It isn't a pretty solution but it works - and beats having a
  1340. statically linked two-megabyte "periodic" demo...
  1341.  
  1342.  
  1343. -----------------------------------------------------------------------------
  1344. Subject: 121)  What is the error  "Unaligned access in XmString" under Ultrix?
  1345.  
  1346. Answer: Compile  XmString.c with STRINGS_ALIGNED.
  1347.  
  1348. -----------------------------------------------------------------------------
  1349. Subject: 122)  TOPIC: KEYSYMS
  1350.  
  1351. -----------------------------------------------------------------------------
  1352. Subject: 123)  What is causing the messages "unknown keysym osfDown..."?  It
  1353. happens when I run an application under Motif 1.1
  1354.  
  1355. Answer: There is an OSF supplied addition to the /usr/lib/X11/XKeysymDB file.
  1356. It is found on the release tape and should have been automatically installed
  1357. if the installation procedure was followed in the Release Notes.
  1358.  
  1359. You have to copy (or append) lib/Xm/XKeysymDB into /usr/lib/X11.  This may
  1360. require root permission.  It is not clear how to fix the problem if you can't
  1361. do this.  The error comes from Xt translation table parsing and can't be fixed
  1362. in Motif, so if you can't get root permission you may be stuck.  The file is
  1363. not copyrighted so you can install it on other systems.
  1364.  
  1365. If X has been built so that XKeysymDB is not in this directory, and you don't
  1366. know where it is looking, run 'strings libX11.a | grep XKeysymDB' to find the
  1367. path.
  1368.  
  1369. On a Sun running openwin with shared libraries, you may need to put the path
  1370. for the library containing XKeysymDB *first* in the path list in
  1371. LD_LIBRARY_PATH, or it may find the wrong XKeysymDB in the wrong directory.
  1372.  
  1373. XKeysymDB simply contains the registered keysym values for the OSF keysyms.
  1374. The OSF values are server-independent.  And, all registered keysyms will be
  1375. included in an XKeysymDB file to be shipped with X11R5.
  1376.  
  1377. In the meantime (till all systems are X11R5+), a list of the registered
  1378. keysyms can be found in the X11R4 release in mit/doc/Registry/Xregistry.
  1379.  
  1380. Also note the XKEYSYMDB environment variable. Setting this to point to the
  1381. XKeysymDB file often helps, but not always...
  1382.  
  1383.  
  1384. -----------------------------------------------------------------------------
  1385. Subject: 124)  What happens if I can't install Motif Keysyms?
  1386.  
  1387. From: tessi!george@nosun.West.Sun.COM (George Mitchell)
  1388.  
  1389. Here's what appears to happen if you don't have XKeysymDB in place to define
  1390. OSF's virtual keysyms:
  1391.  
  1392. 1. At class initialize time, for a widget (such as XmText) that uses virtual
  1393. keysyms in its event translation table, all entries which refer to those
  1394. keysyms fail to parse correctly.  In the case of XmText, instead of ending up
  1395. with a translation table with roughly 90 entries, you end up with one that has
  1396. 29.
  1397.  
  1398. 2. XKeysymDB doesn't exist, so you'd assume that KeyPress events will get
  1399. translated to plain vanilla keysyms, right?  WRONG!  All Motif widgets install
  1400. a virtual keysym translator ANYWAY!  Consequently, the backspace key (for
  1401. example) gets translated to the keysym osfBackSpace.
  1402.  
  1403. 3. Therefore, if you augment or override your widget's translations with
  1404. translations that refer to plain vanilla BackSpace, they will never be
  1405. triggered, because you will NEVER see plain vanilla BackSpace, only
  1406. osfBackSpace.
  1407.  
  1408. 4. But you can't use osfBackSpace in an event translation entry, because you
  1409. don't have XKeysymDB installed!
  1410.  
  1411. Here's how I'm "dealing" with the problem right now: Motif installs its
  1412. virtual keysym translator by calling XtSetKeyTranslator every time a
  1413. VendorShell (or subclass) widget is created.  So every time I create a shell,
  1414. I immediately call XtSetKeyTranslator (display, XtTranslateKey) to restore the
  1415. default translator.  No more funny virtual keysyms!  Now I can reinstall non-
  1416. osfKeySym translations and have them work the way I expect.
  1417.  
  1418.  
  1419. -----------------------------------------------------------------------------
  1420. Subject: 125)  Why has OSF introduced Keysyms into Motif 1.1?  They weren't
  1421. there in Motif 1.0.
  1422.  
  1423. Answer: From: ellis@osf.org
  1424.  
  1425. Virtual Keysyms are meant to provide a consistent keyboard model for Motif
  1426. applications running in a heterogeneous environment in which proprietary (i.e.
  1427. vendor specific) non-Motif applications may also be running.
  1428.  
  1429. First of all, for the sake of the rest of the readers, let's explain why this
  1430. is an issue:
  1431.  
  1432. It would be lovely if Motif's translation tables could just use the obvious
  1433. keysyms predefined by X.  For example, there are keysyms for XK_BackSpace,
  1434. XK_Delete, XK_Left, XK_Right, etc.  Shouldn't these be the ones that are used
  1435. in our translations?  Unfortunately, the problem is not so simple.  Some
  1436. specific examples:
  1437.  
  1438.    While most vendors bind XK_BackSpace to the key at the top right
  1439.    of the standard keyboard (often engraved with a leftwards
  1440.    pointing arrow), not all do.  In fact, some vendors (including DEC)
  1441.    bind that key to XK_Delete.
  1442.  
  1443.    While most vendors bind the arrow keys to XK_Up, etc, a number of
  1444.    vendors (including Sun, on some servers) bind them to function key
  1445.    keysyms.
  1446.  
  1447. A simplistic solution would require the use of xmodmap to change the offending
  1448. bindings.  That would work swell in an all Motif environment.  However, OSF's
  1449. goal (not always perfectly achieved) is interoperability.  That is, we'd like
  1450. to make sure that both Motif and non-Motif programs can happily run in the
  1451. same environment.
  1452.  
  1453. It is expected that a vendor may have a wide variety of existing X-based
  1454. software that uses the keysyms as established by that vendor for specific
  1455. purposes.  It is expected that these applications may run at the same time as
  1456. Motif-based software.  Using xmodmap to change keysyms on the server side
  1457. could "break" the existing applications (or at the very least their
  1458. documentation) by making some keys unavailable, or by moving the location.
  1459.  
  1460. So, we chose not to use xmodmap.  By the way, though OpenLook uses a different
  1461. implementation (they recompile their virtual translation tables into actual
  1462. translation tables), they basically adopted the same approach, presumably for
  1463. similar reasons.
  1464.  
  1465. To work properly, the virtual keysym model we implemented depends on Xlib
  1466. finding XKeysymDB installed appropriately (which standard Motif installation
  1467. does).  This simply defines the keysyms (not the key they are bound to).  This
  1468. unfortunate piece of stupidity is necessary because MIT only includes standard
  1469. keysyms in keysymdef.h.  It should be said that our lives would be made easier
  1470. if MIT would also see fit to include registered keysyms in keysymdef.h as
  1471. well.
  1472.  
  1473. Motif applications determine how to bind virtual to actual keys by looking for
  1474. either a resource or a property on the root window which describes what to do.
  1475. Note that this information is on the server side, so that all applications use
  1476. the same virtual bindings regardless of where they are running.  Mwm will
  1477. happily create the property if it finds a .motifbind file in your home
  1478. directory when it starts up.  (Actually, things generally work even if none of
  1479. this is done, since if all else fails, the Motif toolkit chooses a virtual
  1480. bindings table to use based on the identification of the server).
  1481.  
  1482. The actual implementation of virtual keys is made possible by a hook in the
  1483. Intrinsics.  Undoubtably, the implementation would be simpler and cleaner if
  1484. virtual key support was more directly supported by the Intrinsics.  We will be
  1485. exploring this possibility in the future.
  1486.  
  1487.   -- Ellis
  1488.  
  1489. -----------------------------------------------------------------------------
  1490. END OF PART FOUR
  1491. -- 
  1492. ..........................
  1493.  
  1494.